package com.yubest.jwt.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Date;

@Data
@Component
@ConfigurationProperties(prefix = "jjwt")
public class JwtConfig {

    private String issuer;

    private String key;

    private Long expiration;

    public Date getExpirationDate(Date date) {
        return new Date(date.getTime() + this.expiration);
    }
}
